package com.xckj.teacher.ui.adapter

import android.annotation.SuppressLint
import android.graphics.Color
import android.graphics.drawable.Drawable
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import androidx.recyclerview.widget.RecyclerView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.xckj.teacher.R
import com.xckj.teacher.bean.ClassBean
import com.xckj.teacher.bean.Group
import com.xckj.teacher.bean.Student
import com.xckj.teacher.util.CustomBindAdapter


class GroupAdapter(data: MutableList<Student>) : BaseQuickAdapter<Student, BaseViewHolder>(
    R.layout.item_group_student, data
) {


    @SuppressLint("UseCompatLoadingForDrawables")
    override fun convert(holder: BaseViewHolder, item: Student) {
        holder.setText(R.id.tv_name, "${item.nickname}")
        if (item.is_vip) {
            holder.setGone(R.id.vip, false)
        } else {
            holder.setGone(R.id.vip, true)
        }

        if (item.check) {
            holder.setBackgroundResource(
                R.id.list_item,
                R.drawable.rec_1a2979ff_12
            )
            holder.setTextColor(R.id.tv_name, Color.parseColor("#FF2979FF"))
        } else {
            holder.setBackgroundResource(
                R.id.list_item,
                R.drawable.rec_white_12
            )
            holder.setTextColor(R.id.tv_name, Color.parseColor("#FF333333"))

        }

    }
}
